import { $zpHttp } from '../utils/axios.js'

//后台调用的API
export default { 
    //获取当前登录人信息
    // getLoginUserInfo(group_id){
    //     var promise = new Promise(
    //         function (resolve, reject) {
    //             $zpHttp.get(window.zhaopinGlobal.API+"group/login_user_info" + "?t=" + (new Date().getTime()) + (group_id == undefined?"":"&group_id="+group_id) ).then(function (res) {
    //                 resolve(res.data);
    //             })
    //         });
    //     return promise;
    // },    
    //获取我的人才库表格配置
    getMyTalentPoolTableConfig() {
        var promise = new Promise(
            function(resolve, reject) {
                $zpHttp.get("talentPool/tableConfig.json").then(res => {
                    resolve(res.data);
                })
            }
        )
        return promise;
    },
    //保存我的人才库表格配置
    saveMyTalentPoolTableConfig(params) {
        var promise = new Promise(
            function(resolve, reject) {
                $zpHttp.post("talentPool/tableConfig.json",{params: params}).then(res => {
                    resolve(res.data);
                })
            }
        )
        return promise;
    },
    //获取我的人才库表格数据
    getMyTalentPoolTableData(currentPage) {
        var promise = new Promise(
            function(resolve, reject) {
                $zpHttp.get("talentPool/tableData.json", {currentPage: currentPage}).then(res => {
                    resolve(res.data);
                })
            }
        )
        return promise;
    },
    //保存我的人才库表格数据
    saveMyTalentPoolTableData(params) {
        var promise = new Promise(
            function(resolve, reject) {
                $zpHttp.post("talentPool/tableData.json", {params: params}).then(res => {
                    resolve(res.data);
                })
            }
        )
        return promise;
    },
    //获取我的ATS统计数据
    getMyATSCount() {
        var promise = new Promise(
            function(resolve, reject) {
                $zpHttp.get("talentPool/myATSCount.json").then(res => {
                    resolve(res.data);
                })
            }
        )
        return promise;
    },
    //我保存的搜索条件
    getMySearchData() {
        var promise = new Promise(
            function(resolve, reject) {
                $zpHttp.get("talentPool/mySearchData.json").then(res => {
                    resolve(res.data);
                })
            }
        )
        return promise;
    },
    //
}